package com.situ.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.situ.domain.entity.TProduct;
import com.situ.domain.entity.TProductExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface TProductMapper extends BaseMapper<TProduct> {
    long countByExample(TProductExample example);

    int deleteByExample(TProductExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(TProduct record);

    int insertSelective(TProduct record);

    List<TProduct> selectByExample(TProductExample example);

    TProduct selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") TProduct record, @Param("example") TProductExample example);

    int updateByExample(@Param("record") TProduct record, @Param("example") TProductExample example);

    int updateByPrimaryKeySelective(TProduct record);

    int updateByPrimaryKey(TProduct record);

    /**
     * 分页查询商品
     * @param page
     * @param searchKey
     * @return
     */
    Page<TProduct> searchProductsByPage(Page<TProduct> page, String searchKey);

}